<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="./../template/template.xhtml">
	<ui:define name="content">
		<div class="FORM_HEADER">Employee List</div>
		<br></br>
		<h:form styleClass="APPLICATION_CONTENT">
			<h:dataTable value="#{employeeController.employeeList}"
				var="employee" styleClass="TABLE_BASIC_COMPOSITION"
				headerClass="TABLE_HEADER" rowClasses="ODD_ROW, EVEN_ROW"
				cellpadding="8">
				<p:column>
					<f:facet name="header">Id</f:facet>
					<h:outputText value="#{employee.id}" />
				</p:column>
				<p:column>
					<f:facet name="header">Image</f:facet>
					<p:graphicImage
						value="http://localhost:8080/Pms/faces/ImageServlet?employeeId=#{employee.id}"
						height="80" width="60" />
				</p:column>
				<p:column>
					<f:facet name="header">Emp Code</f:facet>
					<h:outputText value="#{employee.empCode}" />
				</p:column>
				<p:column>
					<f:facet name="header">Name</f:facet>
					<h:outputText value="#{employee.firstName}" />
                        &nbsp;
                        <h:outputText value="#{employee.lastName}" />
				</p:column>
				<p:column>
					<f:facet name="header">Designation</f:facet>
					<h:outputText value="#{employee.destinationId}" />
				</p:column>
				<p:column>
					<f:facet name="header">Email</f:facet>
					<h:outputText value="#{employee.emailId}" />
				</p:column>
				<p:column>
					<f:facet name="header">Action</f:facet>
					<h:commandLink value="View" action="#{employeeController.view}">
						<f:param name="employeeId" value="#{employee.id}" />
					</h:commandLink>
					<h:outputText value=" " />
					<h:commandLink value="Edit" action="#{employeeController.edit}">
						<f:param name="employeeId" value="#{employee.id}" />
					</h:commandLink>
					<h:outputText value=" " />
					<h:commandLink value="Image"
						action="#{employeeController.uploadImage}">
						<f:param name="employeeId" value="#{employee.id}" />
					</h:commandLink>
				</p:column>
			</h:dataTable>
		</h:form>
	</ui:define>
</ui:composition>
</html>